package com;

import com.reverse.engineering.util.core.run.Run;
import com.reverse.engineering.util.core.run.enums.DatabaseType;
import com.reverse.engineering.util.core.run.enums.FieldEquals;
import com.reverse.engineering.util.core.run.enums.FileGenerate;
import com.reverse.engineering.util.core.run.enums.ReadType;

/**
 * 应用程序的配置属性
 * 
 * @author liu
 * @date 2020-08-10
 */
public class ApplicationProperties {

    /**哪种数据库*/
    public static final DatabaseType databaseEnvironment = DatabaseType.MYSQL;
    public static final String SSL = databaseEnvironment.getDatabaseProperties().getDatabaseSsl();
    // public static final String DATABASE_NAME = "so_user";
    // public static final String URL = "jdbc:mysql://192.168.4.34:3306/";
    // public static final String USERNAME = "root";
    // public static final String PASSWORD = "ZHANGjun4081@ksepton";
    public static final String DATABASE_NAME = "zhaopin";
    public static final String URL = "jdbc:mysql://localhost:3306/";
    public static final String USERNAME = "root";
    public static final String PASSWORD = "123456";
    // Oracle连接
    // public static final String DATABASE_NAME = "RAISE_DT";
    // public static final String URL = "jdbc:oracle:thin:@211.152.57.28:1521:orcl";
    // public static final String USERNAME = "unionlive";
    // public static final String PASSWORD = "unionlive";

    /**Xml的ID参数类型和返回类型,不写为动态(当用统一的ID字段的时候类型可以改变)*/
    public static final String idXmlParam = "int";
    /**读取数据库还是读取Excel*/
    public static final ReadType read = ReadType.DATABASE;
    /**如果读取数据库,要读取的表,没有就读全部*/
    public static final String[] tables = {"rent_sentinel"};

    /**导包的排序规则,按数组中的位置排序,其他的包在最上面或最下面(按字母顺序排序)*/
    public static final String[] importSort = {"java", "javax", "org", "com"};
    /**导的其他包在上面还是下面,true:上面,false:下面*/
    public static final boolean importSortOther = false;
    /**每组包之间是否加换行*/
    public static final boolean importSortSpacing = true;

    /**生成文件的基础路径(classpath:下的文件不受影响)*/
    public static String basePath = "com.sojson";
    /**数据库表名的前缀,没有不写*/
    public static String databaseTablePrefix = "rent_";
    /**数据库表名的后缀,没有不写*/
    public static String databaseTableSuffix = "";
    /**resource路径,如果文件要放到resource路径下就加上这个*/
    public static final String classPath = FileGenerate.CLASSPATH.getBasePath();
    /**不设置*/
    public static final String NO = null;
    /**Entity文件生成路径: 不设置为com/sojson/bean/entity*/
    // public static final String entity = "com.zulin.rent.entity.po";
    public static final String entity = "entity.po";
    /**Dao接口文件生成路径: 不设置为com/sojson/dao*/
    // public static final String daoInterface = "com.zulin.rent.dao";
    public static final String daoInterface = "dao";
    /**Dao实现类文件生成路径: 不设置为com/sojson/dao/impl*/
    // public static final String daoImpl = "com.zulin.rent.dao.impl";
    public static final String daoImpl = "dao.impl";
    /**Service接口文件生成路径: 不设置为com/sojson/service*/
    // public static final String serviceInterface = "com.zulin.rent.service";
    public static final String serviceInterface = "service";
    /**Service实现类文件生成路径: 不设置为com/sojson/service/impl*/
    // public static final String serviceImpl = "com.zulin.rent.service.impl";
    public static final String serviceImpl = "service.impl";
    /**Controller实现类文件生成路径: 不设置为com/sojson/controller/vo*/
    // public static final String controllerImpl = "com.zulin.rent.controller.impl";
    public static final String controllerImpl = "controller.impl";
    /**XML文件生成路径: 不设置为resource目录下的mapper*/
    public static final String xml = classPath + "mapper";
    /**Sql文件生成路径: 不设置为项目文件下*/
    public static final String sql = NO;

    /**创建的Sql文件的名称*/
    public static final String sqlName = "So";
    /**Excel文件的路径*/
    public static final String excelPath = "Mybatis数据库设计.xlsx";

    /**主键字段名*/
    public static String id = "id";
    /**编号字段名*/
    public static String serial_number = "no";
    /**删除字段名*/
    public static String is_del = "del_flag";
    /**是否删除字段的所有状态值*/
    public static final int[] DEL_NUMBER_LIST = {1, 2};
    /**被删除后的状态值*/
    public static final int DEL_NUMBER = 2;
    /**是否生成关于ID的方法*/
    public static final boolean generateId = true;
    /**是否生成关于编号的方法*/
    public static final boolean generateSerialNumber = true;
    /**是否生成关于逻辑删除的方法*/
    public static final boolean generateIsDel = true;
    /**是否生成清空数据的方法*/
    public static final boolean generateClear = true;
    /**whereCondition条件(查询条件)是否忽略被逻辑删除的(resources目录下的template目录下的xml目录下的FileTemplate中的ID为whereCondition的<sql>标签)*/
    public static final boolean findIsDel = true;
    /**whereCondition条件(查询条件)是否忽略被逻辑删除的!!!类型!!!(true:根据传过来的参数判断是否不查 ,false:死语句(固定不查))*/
    public static final boolean findIsDelType = true;
    /**whereCondition条件(查询条件)是否忽略被逻辑删除的!!!类型!!!为true时参数的名称*/
    public static final String findIsDelTypeTrueFieldName = "statusNo";
    /**whereCondition条件(查询条件)是否忽略被逻辑删除的!!!类型!!!为true时参数的Java类型*/
    public static final FieldEquals findIsDelTypeTrueFieldType = FieldEquals.INTEGER;

    /**开启类名驼峰命名映射*/
    public static final boolean enableClassMapUnderscoreToCamelCase = true;
    /**开启字段驼峰命名映射*/
    public static final boolean enableFieldMapUnderscoreToCamelCase = true;

    /**数据库创建的时候是否把存在的删掉*/
    public static final boolean dropDatabase = false;
    /**数据表创建的时候是否把存在的删掉*/
    public static final boolean dropTable = false;
    /**数据库表是否加前缀后缀*/
    public static final boolean databasePrefix = true;
    /**从数据库读取的表名有没有加前缀后缀,如果其他类不加前缀而数据表有前缀,就会去掉!!!谨慎使用,可能会把没有前缀的表相同字母去掉*/
    public static final boolean readDatabasePrefix = true;

    /**类作为参数名是否加前缀后缀*/
    public static final boolean paramEnablePrefix = false;

    /**Entity类是否加前缀后缀*/
    public static final boolean entityPrefix = false;

    /**Dao接口是否加前缀后缀*/
    public static final boolean daoInterfacePrefix = false;
    /**Dao实现类是否加前缀后缀*/
    public static final boolean daoImplPrefix = false;

    /**Service接口是否加前缀后缀*/
    public static final boolean serviceInterfacePrefix = false;
    /**Service实现类是否加前缀后缀*/
    public static final boolean serviceImplPrefix = false;

    /**Controller路径是否加前缀后缀*/
    public static final boolean controllerMappingPrefix = false;
    /**Controller路径是否加.后缀*/
    public static final boolean controllerMappingSuffix = false;
    /**Controller实现类是否加前缀后缀*/
    public static final boolean controllerImplPrefix = false;

    public static void main(String[] args) throws Exception {
        Run.run();
    }

    public static boolean isGenerateid() {
        return generateId;
    }

    public static boolean isGenerateserialnumber() {
        return generateSerialNumber;
    }

    public static boolean isGenerateisdel() {
        return generateIsDel;
    }

}